package com.lizhi.note.mapper;


import com.lizhi.note.dto.AppUserDTO;
import com.lizhi.note.dto.NotebookDTO;
import com.lizhi.note.entity.AppUserEntity;
import com.lizhi.note.entity.NotebookEntity;
import org.mapstruct.*;

import java.util.List;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface AppUserMapper {

    AppUserEntity toEntity(AppUserDTO dto);

    AppUserDTO toDto(AppUserEntity entity);

    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    void updateEntity(AppUserDTO dto, @MappingTarget AppUserEntity entity);

    // 列表转换方法
    List<AppUserDTO> toDtoList(List<AppUserEntity> entities);

    List<AppUserEntity> toEntityList(List<AppUserDTO> dtos);
}
